#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int a[] = { 1,2,3,4,5,6,7,8,9,10 };
	int len = sizeof(a) / sizeof(a[0]);
	int left = 0;
	int right = len - 1;
	int tmp = 0;
	while (left < right)
	{
		while (a[left] % 2 == 1)
			left++;
		while (a[right] % 2 == 0)
			right--;
		tmp = a[left];
		a[left] = a[right];
		a[right] = tmp;
	}
	for (int i = 0; i < len; i++)
	{
		printf("%d ",a[i]);
	}
	return 0;
}